//
//  MHViewController.m
//  MiaoCircle
//
//  Created by 许正荣 on 2018/5/12.
//  Copyright © 2018年 acgera. All rights reserved.
//

#import "MHEditMemberInfoViewController.h"
#import "MHEditMemberInfoViewModel.h"
#import "UITextView+Placeholder.h"

@interface MHEditMemberInfoViewController ()
@property(nonatomic, strong)  MHEditMemberInfoViewModel *viewModel;
@end

@implementation MHEditMemberInfoViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.nickNameLable.font = MHRegularFont_16;
    self.memberInfoTextView.font = MHRegularFont_15;
    self.memberInfoTextView.placeholder = @"介绍一下TA...";
    self.memberInfoTextView.placeholderLabel.textAlignment = NSTextAlignmentLeft;
    
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)bindViewModel
{
    [super bindViewModel];
    self.nickNameLable.text = self.viewModel.member.nickName;
    [self.avaterImageView yy_setImageWithURL:[NSURL URLWithString:self.viewModel.member.userFace] placeholder:MHDefaultAvatar(MHDefaultAvatarTypeDefualt)];
    self.memberInfoTextView.text = self.viewModel.member.qaInfo;
    
}

-(void)rightButtonClick
{
    if (self.memberInfoTextView.text.length <= 0) {
        [MBProgressHUD mh_showTips:@"请输入提问详情"];
        return;
    }
    self.viewModel.qInfo = self.memberInfoTextView.text;
    [self.viewModel.saveMemberInfoCommand execute:nil];
    
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
